package cn.javass.dp.flyweight.example4;

import java.util.ArrayList;
import java.util.List;

public class UnsharedConcreteFlyweight implements Flyweight {

    private List<Flyweight> list = new ArrayList<Flyweight>();

    @Override
    public boolean match(String securityEntity, String premit) {
        for (Flyweight flyweight : list) {
            if (flyweight.match(securityEntity, premit)) {
                return true;
            }
        }
        return false;
    }

    @Override
    public void add(Flyweight f) {
        list.add(f);
    }
}
